package book;

public class BookList {
    private Book[] books = new Book[10];
    private int usedSize;//实际放书数量

    public BookList() {
        this.books[0] =  new Book("三国演义","罗贯中","小说",15);
        this.books[1] =  new Book("西游记","吴承恩","小说",15);
        this.books[2] =  new Book("红楼梦","曹雪芹","小说",15);
        this.usedSize = 3;
    }

    public Book getBooks(int pos) {   //相当于查看书架书的信息
        return books[pos];
    }

    public void setBooks(Book book,int pos) {   //相当于通过下标传入位置放书
        books[pos] = book;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
